package com.hanqian.kepler.core.service.core;

import com.hanqian.kepler.common.base.service.BaseService;
import com.hanqian.kepler.common.bean.result.AjaxResult;
import com.hanqian.kepler.core.entity.primary.core.TargetDesc;
import com.hanqian.kepler.core.entity.primary.core.TargetDescZan;
import com.hanqian.kepler.flow.entity.User;

import java.util.List;

/**
 * newFile
 * ============================================================================
 * author : dzw
 * createDate:  2021/1/11 。
 * ============================================================================
 */
public interface TargetDescZanService extends BaseService<TargetDescZan, String> {

	/**
	 * 获取当前指标的点赞列表
	 */
	List<TargetDescZan> getZanListByTargetDesc(TargetDesc targetDesc);

	/**
	 * 检测一个用户是否点了赞
	 */
	boolean checkIfZaned(TargetDesc targetDesc, String userId);

	/**
	 * 执行点赞操作
	 */
	AjaxResult zan(TargetDesc targetDesc, User user);

	/**
	 * 获取某个人在某个指标下赞过的描述ids
	 */
	List<String> findZanDescIds(String targetId, String userId);

	/**
	 * 获取实时的赞数量
	 */
	int getZanCount(TargetDesc targetDesc);

}
